package com.diandi.ddsb.bean;

/**
 * 现金卷使用状态
 * 
 * @author DONGJIE
 */
public enum TicketUseStatus {

	NO_ACTIVITE(0, "未激活"),

	HAS_ACTIVITE(1, "已激活"),

	HAS_USE(2, "已使用"),

	PASS_DUE(3, "失效"),
	
	SYS_SUB(4, "系统扣减");

	/**
	 * 状态名称
	 */
	private final String statusName;
	/**
	 * 状态值
	 */
	private final int statusValue;

	TicketUseStatus(int statusValue, String statusName) {
		this.statusName = statusName;
		this.statusValue = statusValue;
	}
	
	public static TicketUseStatus getTicketUseStatusByValue(int statusValue) {
		for (TicketUseStatus item : TicketUseStatus.values()) {
			if (item.getStatusValue() == statusValue) {
				return item;
			}
		}
		throw new RuntimeException(statusValue + "不是TicketUseStatus的合法type");
	}

	public String getStatusName() {
		return statusName;
	}

	public int getStatusValue() {
		return statusValue;
	}

	@Override
	public String toString() {
		return "StaffStatus{" + "statusName=" + statusName + ", statusValue=" + statusValue + '}';
	}

}
